<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: jiusan
  Date: 21.10.20
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<button type="button" class="btn btn-primary" onclick="toAdd()">添加</button>
<table class="table">
    <tr>
        <td>ID</td>
        <td>品牌</td>
        <td>首字母</td>
        <td>图片</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${page.list}" var="brand">
        <tr>
            <td>${brand.id}</td>
            <td>${brand.name}</td>
            <td>${brand.firstChar}</td>
            <td><img style="width: 50px;height: 50px" src="data:image/png;base64,${brand.pic}"></td>
            <td></td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="5">
            <a onclick="goPage(2)">首页</a>

        </td>
    </tr>
</table>
<script>
    function goPage(page){
        $("#content").load('/brand/list/'+page+'/5');
    }
    function toAdd(){
        $("#content").load('/brand/toAdd');
    }
</script>
</body>
</html>
